﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Framework.Infrastructure.IoC;
using CodeFirstDomain.IService;
using CodeFirstDomain.Model;
using Framework.UnitOfWork;

namespace CodeFirstWebTest
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var users = IoCFactory.Resolve<IUnitOfWork>()
                                  .GetRepository()
                                  .PageFind<User>(0, 10, u => u.ID, u => u.ID != Guid.Empty, true).ToList();

            var user2 = IoCFactory.Resolve<IQueryService>().GetUsers().FirstOrDefault();
            if (user2 != null)
            {
                var str = string.Format("You entered: {0}", user2.Name);
            }
        }
    }
}